#include <iostream>
#include <signal.h>
#include <unistd.h>

using namespace std;

void sigcb(int signo)
{
    cout << "catch a signal, signal number: " << signo << endl;
    sleep(1);
}

int main()
{
    signal(SIGINT, sigcb);

    while (true)
    {
        cout << "proc is running..., pid: " << getpid() << endl;
        sleep(1);
    }

    return 0;
}